#ifndef QUEUE_H_INCLUDED
#define QUEUE_H_INCLUDED

#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "util.h"
#include "linked.h"

typedef struct {
    linked_t* sentinel;
    linked_t* current;
} queue_t;

#define SENTINEL (-1)

queue_t* queue_create();
void queue_insert(queue_t* queue, linked_t *new);
linked_t* queue_pop(queue_t* queue);
void queue_rev_print(queue_t* queue);
void queue_print(queue_t* queue);
bool queue_is_empty(queue_t* queue);
void queue_push_context(queue_t* queue, ucontext_t* context, int priority);
void queue_reset_links(queue_t *queue, linked_t*(*callback)(int));
#endif //QUEUE_H_INCLUDED
